package com.lyhengtongwl.zqsnews.net;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;

public class NoVerifyTask {
    private static Retrofit retrofit = null;

    //获取任务实例
    public static ApiService getApiService() {

        return getRetrofit().create(ApiService.class);
    }

    private static Retrofit getRetrofit() {
        if (retrofit == null) {
            retrofit = new Retrofit.Builder()
                    .baseUrl(Url.BaseUrl)
                    .addConverterFactory(ScalarsConverterFactory.create())
                    .addConverterFactory(GsonConverterFactory.create())
                    .build();
        }
        //封装
        return retrofit;
    }
}
